import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';
//索赔结算单
//结算单状态
export const getPartType = (params) => axios.get(`${SERVER.CLAIMFAC}/const/getBaseDataByType`, { params });
//*********************************新增*********************************//
//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rPSettle/saveOne`, params);
//*********************************删除*********************************//
//主页面的单条删除
export const deleteOne = (id, params) => axios.post(`${SERVER.CLAIMFAC}/rPSettle/updateStatusById/${id}`,{params} );

//*********************************修改*********************************//
//编辑的保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rPSettle/updateByPtId`,  params );
//修改回显
export const quyrPSettle = (id, params) => axios.get(`${SERVER.CLAIMFAC}/rPSettle/selectById/${id}`, { params });
//*********************************查*********************************//
//结算单检索
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rpBatch/getListByPage`, params);
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rpBatch/getListForExportStatement`, params, {
  responseType: 'blob'
});
//下载中心导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);
//导出
export const getListForExportDetail = (params) => axios.post(`${SERVER.CLAIMFAC}/rpBatch/queryAndExportDetailsOfClaimStatement`, params, {
  responseType: 'blob'
});

// //导出
// export const getListForExportDetail = (params) => axios.post(`${SERVER.CLAIMFAC}/textController/exportStatisticsReport`, params, {
//   responseType: 'blob'
// });


// //修改回显
// export const quyrPBatch = (id, params) => axios.get(`${SERVER.CLAIMFAC}/rPBatch/selectById/${id}`, { params });



//审核回显
export const quyrpBatch = (id, params) => axios.get(`${SERVER.CLAIMFAC}/rpBatch/selectById/${id}`, { params });


//索赔结算单维护首页查询
export const getClaimAccountInfo = params => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/getClaimAccountInfo`, params);

//索赔结算单首页导出
export const getClaimListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/getListForExport`, params,{
  responseType: 'blob'
});

//根据结算单号查询索赔单
export const getClaimInfoByNo = (no, params) => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/getClaimInfoByNo/${no}`, params);

//根据结算单号查询索赔单总数
export const getCloseAccountCount = (no, params) => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/getCloseAccountCount/${no}`, params);

//索赔结算单维护下发按钮
export const updateSettleStateByNo = params => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/updateSettleStateByNo`, params);

//根据结算单号查询索赔单各项金额
export const getCostCountByNo = (no, params) => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/queryClaimAccountCount/${no}`, params);

//索赔结算单维护结算按钮
export const closeAccount = params => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/closeAccountAll`);

//编辑页面维护商务金额
export const updateBusinessMoney = (no, settleId, params) => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/updateBusinessMoney/${no}/${settleId}`, params);

//根据结算单号查询索赔单总数
export const getCbClaim = (no, params) => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/getCbClaim/${no}`, params);


//索赔结算统计报表查询
export const queryClaimStatementReport = params => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/queryClaimStatementReport`, params);

//索赔结算统计报表导出
export const claimStatementReportForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rpClaim/closeAccount/claimStatementReportForExport`, params,{
  responseType: 'blob'
});